package com.zhanglinfeng.feignhystrix.controller;

import com.zhanglinfeng.api.entity.UserEntity;
import com.zhanglinfeng.api.response.ResultResponse;
import com.zhanglinfeng.api.service.LoginFeign;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;


@RestController
public class LoginController {

    @Autowired
    private LoginFeign loginFeign;

    @PostMapping(value = "/login", consumes = MediaType.APPLICATION_JSON_VALUE, produces = MediaType.APPLICATION_JSON_VALUE)
    public ResultResponse<String> login(@RequestBody UserEntity user) {
        return loginFeign.login(user);
    }
}
